package com.theta.gateway.infra.common.enums;

/**
 * 有效标识枚举
 * 
 * @author theta
 *
 */
public enum ValidFlagEnum {

	/**
	 * 有效数据
	 */
	VALID(1, "有效"), 
	/**
	 * 无效或被删除
	 */
	INVALID(0, "无效"),
	
	YES(1,"是"),
	NO(0,"否"),
	
	ENABLED(1,"启用"),
	DISABLED(0,"禁用"),
	
	;
	
	

	private int code;
	private String name;

	ValidFlagEnum(int code, String name) {
		this.code = code;
		this.name = name;
	}

	public int getCode() {
		return code;
	}

	public String getName() {
		return name;
	}

	public static ValidFlagEnum parse(int status) {
		for (ValidFlagEnum statusEnum : ValidFlagEnum.values()) {
			if (statusEnum.getCode() == status) {
				return statusEnum;
			}
		}
		return null;
	}
}
